<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/select/form_field_select_semidynamic_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class CI_Type_Attr_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_name = $form->get_field('name');
		$f_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_name->get_name(), $f_name);
		$this->add_field_view('name', $f_name_view);

		$f_hid = $form->get_field('hid');
		$f_hid_view = new Form_Field_Text_View($form->get_name().'_'.$f_hid->get_name(), $f_hid);
		$this->add_field_view('hid', $f_hid_view);

		$f_ci_type_attr = $form->get_field('ci_type_attr');
		$f_ci_type_attr_view = new Form_Field_Select_Semidynamic_View($form->get_name().'_'.$f_ci_type_attr->get_name(), $f_ci_type_attr);
		$this->add_field_view('ci_type_attr', $f_ci_type_attr_view);

		$f_required = $form->get_field('required');
		$f_required_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_required->get_name(), $f_required);
		$this->add_field_view('required', $f_required_view);

		$f_multiple = $form->get_field('multiple');
		$f_multiple_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_multiple->get_name(), $f_multiple);
		$this->add_field_view('multiple', $f_multiple_view);

		$f_params = $form->get_field('params');
		$f_params_view = new Form_Field_Text_View($form->get_name().'_'.$f_params->get_name(), $f_params);
		$this->add_field_view('params', $f_params_view);
	}
}